package com.study.www.service.impl;

import com.study.www.model.JobConfig;
import com.study.www.service.ConfigService;
import com.study.www.service.ScheduleTaskService;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.time.LocalDateTime;

/**
 * ScheduleTask: 定时任务的服务
 *
 * @date :  2018/2/23    16:29
 **/
@Service
public class ScheduleTaskServiceImpl implements ScheduleTaskService {

    private static final Logger log= LoggerFactory.getLogger(ScheduleTaskServiceImpl.class);

    @Autowired
    private ConfigService configService;

    @Override
    public void test1(JobConfig config){
        System.out.println(configService.findAll());
        LocalDateTime time = LocalDateTime.now();
        log.info("test1>>>!:当前时间="+time.getHour()+"时"+time.getMinute()+"分"+time.getSecond()+"秒"+".Config={}",config);
    }
    @Override
    public void test2(JobConfig config){
        System.out.println(configService.findAll());
        LocalDateTime time = LocalDateTime.now();
        log.info("test2>>>!:当前时间="+time.getHour()+"时"+time.getMinute()+"分"+time.getSecond()+"秒"+".Config={}",config);
    }
}
